package thread;
class Mythread extends Thread{
    @Override
    public void run() {
        while (true){
            try {
                Thread.sleep(1000);
                System.out.println("hellow world");
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}

public class demo1 {
    public static void main(String[] args) {

        Mythread t1 = new Mythread();
        // 开启线程
        t1.start();

        while (true){
     System.out.println("hellow main");
        }

    }



}
